package com.hskn.hss.module.alarmsheshi.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hskn.hss.core.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.poi.ss.usermodel.IndexedColors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author hskn
 * @since 2021-05-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class AlarmSheshiCharts implements Serializable {

    /**
     * 设施Id
     */

    private String  sheshiId;
    /**
     * 设施名称
     */
    @Excel(name = "设施名称", align = Excel.Align.CENTER, height = 18, width = 20)
    private String  sheshiName;
    /**
     * 设施类型
     */
    @Excel(name = "设施类型", align = Excel.Align.CENTER, height = 18, width = 16)
    private String  sheshiType;
    /**
     * 机构名称
     */
    @Excel(name = "机构名称", align = Excel.Align.CENTER, height = 18, width = 28)
    private String  depName;
    /**
     * 全部报警（次）
     */
    @Excel(name = "全部报警（次）", align = Excel.Align.CENTER, height = 18, width = 16, color = IndexedColors.DARK_RED)
    private Integer  allCount;
    /**
     * 机构Id
     */
    private String  depId;
    /**
     * 硫化氢报警数
     */
    @Excel(name = "硫化氢报警（次）", align = Excel.Align.CENTER, height = 18, width = 16, color = IndexedColors.DARK_YELLOW)
    private Integer  H2SCount = 0;
    /**
     * 耗电报警数
     */
    @Excel(name = "耗电报警（次）", align = Excel.Align.CENTER, height = 18, width = 16, color = IndexedColors.DARK_YELLOW)
    private Integer  consumePowerCount = 0;
    /**
     * 烟雾报警数
     */
    @Excel(name = "烟雾报警（次）", align = Excel.Align.CENTER, height = 18, width = 16, color = IndexedColors.DARK_YELLOW)
    private Integer  smokeCount = 0;
    /**
     * 氨气报警数
     */
    @Excel(name = "氨气报警（次）", align = Excel.Align.CENTER, height = 18, width = 16, color = IndexedColors.DARK_YELLOW)
    private Integer  NH4Count = 0;
    /**
     * 时间
     */
    private String alarmTime;

    private List<String> resList;

    public List<Object> getResList() {
        List<Object> resList=new ArrayList<>();
        if (allCount!=null){
            resList.add(allCount);
        }else {
            resList.add(0);
        }
        if (NH4Count!=null){
            resList.add(NH4Count);
        }else {
            resList.add(0);
        }
        if (smokeCount!=null){
            resList.add(smokeCount);
        }else {
            resList.add(0);
        }
        if (consumePowerCount!=null){
            resList.add(consumePowerCount);
        }else {
            resList.add(0);
        }
        if (H2SCount!=null){
            resList.add(H2SCount);
        }else {
            resList.add(0);
        }
        return resList;
    }
}
